//
//  TDJScrollAdView.h
//  淘代驾
//
//  Created by trimaximus on 14-1-20.
//  Copyright (c) 2014年 muyekeji. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol TDJScrollViewDataSource;
@protocol TDJScrollViewDelegate;

@interface TDJScrollAdView : UIView<UIScrollViewDelegate>

@property (readonly, nonatomic) UIScrollView *scrollView;
@property (readonly, nonatomic) UIPageControl *pageControl;
@property (assign, nonatomic) NSInteger currentPage;
@property (assign, nonatomic) NSInteger totalPages;
@property (strong, nonatomic) NSMutableArray *currentViews;
@property (strong, nonatomic) NSTimer *timerScroll;

@property (weak, nonatomic) id<TDJScrollViewDelegate>delegate;
@property (weak, nonatomic) id<TDJScrollViewDataSource>dataSource;

- (void)reloadData;
- (void)setViewContent:(UIView *)view atIndex:(NSInteger)index;

@end

@protocol TDJScrollViewDataSource <NSObject>

@required
- (NSInteger)numberOfPages;
- (UIView *)pageAtIndex:(NSInteger)index;

@end

@protocol TDJScrollViewDelegate <NSObject>

- (void)didClickPage:(TDJScrollAdView *)view atIndex:(NSInteger)index;

@end